home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_monojackal4.cog < prev    next >
Text File  |  1999-11-15  |  18KB  |  791 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_monojackal4.cog
  4. #
  5. # mystic eye critter #4
  6. #
  7. # [RKD & revised by HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. symbols
  13. message    startup
  14. message    activated
  15. message    entered
  16. message    exited
  17. message    arrived
  18. message    user1
  19. message    pulse
  20.  
  21. # keyframes
  22. keyframe    lookdown=0in_stand5.key        local
  23.  
  24. # world things
  25. thing    rotator
  26. thing    jackal            nolink
  27. thing    jackalbase        nolink
  28. thing    sparkle            nolink
  29. thing    activeye
  30. thing    eye
  31. thing    RuinsWindow
  32.  
  33. # flame inside pyramid
  34. thing    flame        nolink
  35.  
  36. # actors
  37. thing    player        nolink    local
  38. thing    indyactor0    nolink
  39. thing    indyactor1    nolink
  40. thing    indyactor2    nolink
  41.  
  42. # camera things
  43. thing    jackalcam
  44. thing    jkl_rocam    nolink
  45. thing    rotatecam    nolink
  46. thing    returncam    nolink
  47. thing    hintcam        nolink
  48. thing    cam1spot    local
  49.  
  50. # camera lookthings
  51. thing    rotatecamlook    nolink
  52. thing    jackalcamlook    nolink
  53. thing    jkl_ct_a        nolink
  54. thing    jkl_ct_b        nolink
  55. thing    jkl_rotarg        nolink
  56. thing    cam1look        local
  57.  
  58. # pushblocks around pushyjackal
  59. thing    block1
  60. thing    block2
  61. thing    block3
  62.  
  63. # creation aids
  64. template    tpl_ghost=ghost                local
  65.  
  66. # surface over monojackal
  67. surface    sandtrigger
  68.  
  69. # surface where block can stop the beam
  70. surface    eyetrigger        mask=0x480
  71.  
  72. # Indy's saylines
  73. sound    prismhere=pr13j02.wav            local
  74. sound    operation=pr13j03.wav            local
  75. sound    okaywhat=pr13j04.wav            local
  76. sound    goodlook=pr13j05.wav            local
  77. sound    there=pr13j06.wav                local
  78. sound    whoa=inxj007a.wav                local
  79.  
  80. # non-voice sounds
  81. sound    crump=pyr_jackal_stat_start.wav        local
  82. sound    turnstart=nub_2mstep_move_c.wav        local
  83. sound    turnloop=teo_spike_block_c.wav        local
  84. sound    turnstop=gen_stone_stop_c.wav        local
  85. sound    eyein=gen_grenade_bounce.wav        local
  86. sound    jackalmove=pyr_jackal_stat_move.wav    local
  87.  
  88. # music
  89. sound    riseup1=mus_pyr_jackal1.wav            local    #long version, for first time jackal comes up
  90. sound    riseup2=mus_pyr_jackal2.wav            local
  91. sound    turnround1=mus_pyr_jackalgem2.wav    local
  92. sound    turnround4=mus_pyr_jackalgem1.wav    local   #long version, for when door finally opens
  93.  
  94. # cogs
  95. cog        bigfancydoor
  96. cog        boxcog
  97. cog        glowcog
  98.  
  99. # variables
  100. vector    posOffset        local
  101. vector    angOffset        local
  102.  
  103. int        vibe            local
  104. int        shake=0            local
  105. int        in_keytrack1    local
  106. int        camexists        local
  107.  
  108. int        locked=0        local
  109. int        actornum=0        local
  110. int        cursound=0        local
  111. int        blockinway=0    local
  112.  
  113. # subroutines
  114. flex    startscene=0.0        local
  115. flex    endscene=0.0        local
  116. flex    fixcams=0.0            local
  117. flex    movejackal=0.0        local
  118. flex    doorcall=0.0        local
  119.  
  120. end
  121. # ==============================================================================
  122.  
  123. code
  124. startup:
  125.     Sleep(0.1);
  126.     player = GetLocalPlayerThing();
  127.     
  128.     # make eye and "activation eye" invisible
  129.     SetThingFlags(eye, 0x10);
  130.     SetThingFlags(activeye, 0x10);
  131.  
  132.     # make sure sandtrigger is no-move
  133.     ClearAdjoinFlags(sandtrigger, 2);
  134.     
  135.     # light up jackal to avoid popping
  136.     SetThingLight(jackal, '100 87 75', .001, .01);
  137.     SetThingLight(jackalbase, '100 87 75', .001, .01);
  138.     SetThingLight(eye, '100 87 75', .001, .01);
  139.     SetThingLight(block1, '100 87 75', .001, .01);
  140.     SetThingLight(block2, '100 87 75', .001, .01);
  141.     SetThingLight(block3, '100 87 75', .001, .01);
  142.  
  143.     # every frame is sacred
  144.     SetThingFlags(jackalbase, 0x10);
  145.     
  146.     # hide sparkle on eye (animated in proximityglow.cog) and attach it to eye
  147.     AnimateSpriteSize(sparkle, '.1 .1 0.0', '.2 .2 0.0', .1);
  148.     AttachThingToThingEx(sparkle, jackal, 0x08);
  149.  
  150.     return;
  151.  
  152. # ..............................................................................
  153.  
  154. user1:
  155. # ---> JackalBlockTrigger cog
  156.     
  157.     #if already triggered, or if light room not prepared, return
  158.     if (locked) return;
  159.     if (GetThingFlags(flame) & 0x10) return;
  160.     
  161.     # a switch-trigger sound
  162.     PlaySoundThing(crump, jackalbase, 1, -1, -1, 0);
  163.  
  164.     # jackalbase makes assembly rise, rotator makes jackal and parts turn
  165.     AttachThingToThing(rotator, jackalbase);
  166.     AttachThingToThing(jackal, rotator);
  167.     AttachThingToThing(eye, jackal);
  168.     AttachThingToThing(activeye, eye);
  169.     
  170.     # get player closer to center, call scene setup, and move the jackal up
  171.     Sleep(0.25);
  172.     actornum=0;
  173.     
  174.     # orient actor without moving him from center
  175.     CopyOrient(player, indyactor0[actornum]);
  176.     
  177.     # start early sound on jackalbase
  178.     cursound = PlaySoundThing(jackalmove, jackalbase, .5, -1, -1, 1);
  179.     ChangeSoundVol(cursound, 1, 1);
  180.     
  181.     # start cam shake...
  182.     shake = 1;
  183.     SetPulse(0.1);
  184.  
  185.     # Indy stops...
  186.     if (MakeMeStop() == -1)
  187.     {
  188.         SetPulse(0);
  189.         return;
  190.     }
  191.  
  192.     StartCutScene(1);
  193.     
  194.     # jackalbase can show up now
  195.     ClearThingFlags(jackalbase, 0x10);
  196.     
  197.     locked = 1;
  198.  
  199.     in_keytrack1 = PlayKey(player, lookdown, 4, 0x00, 0);
  200.     Sleep(1.0);
  201.     
  202.     call startscene;
  203.     call movejackal;
  204.  
  205.     return;
  206.  
  207. # ..............................................................................
  208.  
  209. startscene:
  210.  
  211.     call fixcams;    
  212.  
  213.     TeleportThing(player, indyactor0[actornum]);
  214.     CopyPlayerHolsters(player, indyactor0[actornum]);
  215.     ClearThingFlags(indyactor0[actornum], 0x80000);
  216.     AISetCutSceneMode(indyactor0[actornum]);
  217.     SetThingFlags(player, 0x80000);
  218.     
  219.     # turn collision off on boxes
  220.     SetCollideType(block1, 0);
  221.     SetCollideType(block2, 0);
  222.     SetCollideType(block3, 0);
  223.  
  224.     return;
  225.     
  226. # ..............................................................................
  227.  
  228. movejackal:
  229.  
  230.     # if jackalbase is down, send it up
  231.     if (GetCurFrame(jackalbase) == 0)
  232.     {                        
  233.         # stop preliminary sound
  234.         StopSound(cursound, .5);
  235.         
  236.         # Change to jackalcam
  237.         SetCameraFocus(2, jackalcam);        
  238.         SetCameraSecondaryFocus(2, jkl_ct_a);
  239.         SetCurrentCamera(2);
  240.         ResetCameraFOV(0, 0.0);
  241.         StopKey(player, in_keytrack1, 0.0);
  242.         in_keytrack1 = PlayKey(indyactor0[actornum], lookdown, 4, 0x10, 0);
  243.  
  244.         SetCurrentCamera(2);
  245.         
  246.         # global5 = number of light sentries that have risen from the sand
  247.         # global5 is initialized in monojackal.cog and updated AFTER each light sentry has risen
  248.         # play music depending on 1st or later instances
  249.         if (global5 == 0)
  250.         {
  251.             PlaySoundLocal(riseup1, 1, 0, 0, 0);
  252.         }
  253.         else
  254.         {
  255.             PlaySoundLocal(riseup2, 1, 0, 0, 0);
  256.         }
  257.         
  258.         # Make sure Indy rises with statue
  259.         DetachThing(indyactor0);
  260.  
  261.         # make sand floor movethru
  262.         SetAdjoinFlags(sandtrigger, 2);
  263.         
  264.         # light sentry moves up
  265.         MoveToFrame(jackalbase, 1, .5);
  266.                 
  267.         # if this is the first time, indy reacts appropriately
  268.         if (global5 == 0)
  269.         {
  270.             PlayVoice(indyactor0, whoa, 1, 0);
  271.         }
  272.         else
  273.         {
  274.             # Indy turns to look at front of statue
  275.             SetThingMaxHeadVel(indyactor0, 175);
  276.             SetThingMaxRotVel(indyactor0, 175);
  277.             StopKey(indyactor0[actornum], in_keytrack1, 0.5);
  278.             Sleep(0.5);
  279.             AISetLookThing(indyactor0, indyactor2);
  280.         }
  281.     
  282.         # Move jackal camera back to show Indy and jackal together...
  283.         SetCameraLookInterp(2, 1);
  284.         SetCameraInterpSpeed(2, 3.5);
  285.         Sleep(1.0);
  286.  
  287.         # Track jackal...
  288.         SetCameraSecondaryFocus(2, jkl_ct_b);
  289.         MoveToFrame(jackalcam, 1, 0.7);
  290.         SetCameraFOV(100, 1, 3.5);
  291.             
  292.         # Indy turns to look at pyramid
  293.         Sleep(0.5);
  294.         StopKey(indyactor0[actornum], in_keytrack1, 0.5);
  295.         Sleep(0.5);
  296.         SetThingMaxHeadVel(indyactor0, 175);
  297.         SetThingMaxRotVel(indyactor0, 175);
  298.         AISetLookThing(indyactor0, flame);
  299.     }
  300.     # if jackalbase is up, send it down
  301.     else
  302.     {
  303.         MoveToFrame(jackalbase, 0, 0.7);
  304.         shake = 1;
  305.         SetPulse(0.1);        
  306.         Sleep(3.0);
  307.         SetPulse(0.0);
  308.         call endscene;
  309.  
  310.         # give jackalbase time to arrive, then clean up
  311.         WaitForStop(jackalbase);
  312.         sleep(1);
  313.         DestroyThing(jackalbase);
  314.         DestroyThing(rotator);
  315.         DestroyThing(eye);
  316.         DestroyThing(activeye);
  317.     }
  318.     
  319.     return;    
  320.  
  321. # ..............................................................................
  322.         
  323. activated:
  324. # --> ActivEye    
  325.  
  326.     if (GetSenderRef() != activeye) return;
  327.     
  328.     # if player holds gemeye or within Marcus
  329.     if ((GetCurItem(player) == 65) || (InEditor() && (GetThingFlags(eye) & 0x10)))
  330.     {    
  331.         actornum = 1;
  332.         
  333.         # prepare player
  334.         if (MakeMeStop() == -1) return;
  335.         DeselectWeaponWait(player);
  336.         
  337.         StartCutScene(1);
  338.  
  339.         TeleportThing(indyactor0[actornum], player);
  340.         CopyPlayerHolsters(player, indyactor0[actornum]);
  341.         ClearThingFlags(indyactor0[actornum], 0x80000);
  342.         AISetCutSceneMode(indyactor0[actornum]);
  343.         SetThingFlags(player, 0x80000);
  344.         SetCollideType(block1, 0);
  345.         SetCollideType(block2, 0);
  346.         SetCollideType(block3, 0);
  347.  
  348.         call fixcams;
  349.  
  350.         if (camexists == 0)
  351.         {
  352.             cam1spot = CreateThing(tpl_ghost, player);
  353.             CaptureThing(cam1spot);
  354.             cam1look = CreateThing(tpl_ghost, player);
  355.             CaptureThing(cam1look);
  356.             camexists = 1;
  357.         }
  358.         Sleep(0.01);
  359.         MakeCamera2LikeCamera1(cam1spot, cam1look);
  360.         SetCameraFocus(2, cam1spot);
  361.         SetCameraSecondaryFocus(2, cam1look);
  362.         SetCurrentCamera(2);
  363.         ResetCameraFOV(0, 0.0);
  364.         Sleep(0.01);
  365.         SetCameraLookInterp(2, 1);
  366.         SetCameraPosInterp(2, 1);
  367.         SetCameraInterpSpeed(2, 0.8);
  368.         Sleep(0.01);    
  369.         
  370.         # Dolly to camera behind Indy...
  371.         SetCameraFocus(2, jkl_rocam);
  372.         SetCameraSecondaryFocus(2, jkl_rotarg);
  373.         
  374.         # global6 = number of times the player has applied the eye
  375.         # global6 is initialized in monojackal.cog and updated AFTER each bar is removed from the door
  376.         #indy applies the eye (and sayline if 1st time)
  377.         if (global6 == 0)
  378.         {
  379.             PlayVoice(indyactor1, operation, 1, 0);
  380.             Sleep(2.0);
  381.         }
  382.         
  383.         # if door is about to open and lightbeam isn't blocked, play long version
  384.         if ((global6 == 3) && (!blockinway))
  385.         {
  386.             PlaySoundLocal(turnround4, 1, 0, 0, 0);
  387.         }
  388.         else
  389.         {
  390.             # otherwise play short version
  391.             PlaySoundLocal(turnround1, 1, 0, 0, 0);
  392.         }
  393.     
  394.         PlayMode(indyactor1, 61, 0);
  395.         Sleep(0.5);
  396.         
  397.         # make eye visible and take it out of inventory
  398.         PlaySoundThing(eyein, eye, 1, -1, -1, 0);
  399.         ClearThingFlags(eye, 0x10);
  400.         ChangeInv(player, 65, -1);
  401.         Sleep(1.0);
  402.  
  403.         SetCameraLookInterp(2, 0);
  404.         SetCameraPosInterp(2, 0);
  405.  
  406.         # assembly rotates, camera slides sideways
  407.         PlaySoundThing(turnstart, jackalbase, 1, -1, -1, 0);
  408.         cursound = PlaySoundThing(turnloop, jackalbase, 1, -1, -1, 1);
  409.  
  410.         Rotate(rotator, -180, 1, 5);
  411.         AttachThingToThing(jkl_rocam, jkl_rotarg);
  412.         Rotate(jkl_rotarg, -150, 1, 5.0);
  413.         SetCameraFOV(70, 1, 5.0);
  414.         Sleep(2.5);
  415.         
  416.         # New sayline if this is the 2nd time
  417.         if (global6 == 1)
  418.         {
  419.             PlayVoice(indyactor1, okaywhat, 1, 0);
  420.         }
  421.         
  422.         # New sayline if this is the 3rd time
  423.         if (global6 == 2)
  424.         {
  425.             PlayVoice(indyactor1, goodlook, 1, 0);
  426.         }
  427.     }
  428.     else
  429.     {
  430.         # player doesn't have the gem and it's not on the jackal, Indy gives a hint
  431.         if (GetThingFlags(eye) & 0x10)
  432.         {
  433.             # prepare player
  434.             if (MakeMeStop() == -1) return;
  435.             DeselectWeaponWait(player);
  436.             
  437.             StartCutscene(1);
  438.  
  439.             SetCollideType(block1, 0);
  440.             SetCollideType(block2, 0);
  441.             SetCollideType(block3, 0);
  442.  
  443.             SetCameraLookInterp(2, 0);
  444.             SetCameraPosInterp(2, 0);
  445.  
  446.             if (camexists == 0)
  447.             {
  448.                 cam1spot = CreateThing(tpl_ghost, player);
  449.                 CaptureThing(cam1spot);
  450.                 cam1look = CreateThing(tpl_ghost, player);
  451.                 CaptureThing(cam1look);
  452.                 camexists = 1;
  453.             }
  454.             
  455.             MakeCamera2LikeCamera1(cam1spot, cam1look);
  456.             SetCameraFocus(2, cam1spot);
  457.             SetCameraSecondaryFocus(2, cam1look);
  458.             SetCurrentCamera(2);
  459.             ResetCameraFOV(0, 0.0);
  460.             SetCameraLookInterp(2, 1);
  461.             SetCameraPosInterp(2, 1);
  462.             SetCameraInterpSpeed(2, 0.8);
  463.             Sleep(0.01);
  464.             SetCameraFocus(2, hintcam);
  465.             SetCameraSecondaryFocus(2, eye);
  466.             Sleep(0.5);
  467.  
  468.             # Indy needs prism...
  469.             PlayVoice(player, prismhere, 1, 1);
  470.             Sleep(0.5);
  471.             
  472.             # Restore player, end scene
  473.             SetCameraPosition(1, GetThingPos(hintcam));
  474.             SetCurrentCamera(1);
  475.             Sleep(0.5);
  476.  
  477.             EndCutscene();
  478.             SetCollideType(block1, 3);
  479.             SetCollideType(block2, 3);
  480.             SetCollideType(block3, 3);
  481.             ClearActorFlags(player, 0x200000);
  482.  
  483.             return;    
  484.         }
  485.  
  486.         # player takes gem from jackal
  487.         if (MakeMeStop() == -1) return;
  488.         DeselectWeaponWait(player);
  489.         
  490.         actornum = 2;
  491.         call startscene;
  492.         
  493.         # cut to camera next to Indy
  494.         SetCameraFocus(2, returncam);
  495.         SetCameraSecondaryFocus(2, jkl_rotarg);
  496.         SetCurrentCamera(2);
  497.         
  498.         # make eye invisible on jackal and add it to inventory
  499.         PlayMode(indyactor2, 61, 0);
  500.         Sleep(0.5);
  501.         PlaySoundThing(eyein, eye, 1, -1, -1, 0);
  502.         SetThingFlags(eye, 0x10);
  503.         SetThingLight(eye, VectorSet(0, 0, 0), .001, .1);
  504.         ChangeInv(player, 65, 1.0);
  505.         SetInvAvailable(player, 65, 1);
  506.         JonesInvItemChanged(65);
  507.         
  508.         # detach these to avoid rotation slowness
  509.         DetachThing(eye);
  510.         DetachThing(activeye);
  511.         
  512.         # rotate jackal back around
  513.         PlaySoundThing(turnstart, jackalbase, 1, -1, -1, 0);
  514.         cursound = PlaySoundThing(turnloop, jackalbase, 1, -1, -1, 1);
  515.         Rotate(rotator, 180, 1, 4);        
  516.     }
  517.  
  518.     return;
  519.  
  520. # BlockInWay states
  521. #    -1 = doorcog triggered (i.e., moot point)
  522. #    0 = block not on face
  523. #    1 = block on face, jackal not in place yet
  524. #    2 = block on face, jackal in place
  525.  
  526. # ..............................................................................
  527.  
  528. entered:
  529. # ---> EyeTrigger
  530.  
  531.     if (blockinway == -1) return;
  532.     if (GetSenderRef() != eyetrigger) return;
  533.  
  534.     # if block enters surface, set flag to keep eye from seeing pyramid
  535.     if ((GetSourceRef() == block1) || (GetSourceRef() == block2) || (GetSourceRef() == block3))
  536.     {
  537.         blockinway = 1;
  538.     }
  539.     return;
  540.  
  541. # ..............................................................................
  542.  
  543. exited:
  544. # ---> EyeTrigger
  545.  
  546.     if (blockinway == -1) return;
  547.     if (GetSenderRef() != eyetrigger) return;
  548.  
  549.     # if block exits surface and blockinway
  550.     if ((GetSourceRef() == block1) || (GetSourceRef() == block2) || (GetSourceRef() == block3))
  551.     {
  552.  
  553.         if (blockinway == 2)
  554.         {
  555.             Sleep(1.0);
  556.             
  557.             StartCutscene(1);
  558.             SetActorFlags(player, 0x200000);
  559.             
  560.             # allow camera to pass through ruins
  561.             SetCollideType(RuinsWindow, 0);        
  562.  
  563.             # swing camera left or right, dependent on player's facing
  564.             if (VectorY(GetThingLVecPYR(player)) > 0)
  565.             {
  566.                 SetExtCamOffset('-0.3 -.08 0.22');
  567.             }
  568.             else
  569.             {
  570.                 SetExtCamOffset('0.3 -.08 0.22');
  571.             }
  572.  
  573.             SetCameraFOV(75, 1, 4);
  574.             
  575.             PlaySoundLocal(turnround4, 1, 0, 0, 0);
  576.             Sleep(2.0);
  577.  
  578.             # make the eye sparkle a couple times
  579.             AnimateSpriteSize(sparkle, '.08 .08 0.0', '.15 .15 1.0', .1);
  580.             Sleep(2.0);
  581.  
  582.             call doorcall;
  583.  
  584.             # restore ruins collision and disable blockinway
  585.             SetCollideType(RuinsWindow, 3);
  586.             blockinway = -1;
  587.         }
  588.         else
  589.         {
  590.             blockinway = 0;
  591.         }
  592.     }
  593.  
  594.     return;
  595.  
  596. # ..............................................................................
  597.  
  598. arrived:
  599. # ---> JackalCam or Rotator
  600.     
  601.     # ==JackalCam==
  602.     # pause and call endscene
  603.     if (GetSenderRef() == jackalcam)
  604.     {
  605.         Sleep(1.0);    
  606.         SetPulse(0.0);
  607.         Sleep(1.5);
  608.         call endscene;
  609.         
  610.         #add 1 to monojackal rise count
  611.         global5 = global5 + 1;
  612.         
  613.         return;
  614.     }
  615.     
  616.     # ==Rotator==
  617.     # if eye invisible, move jackal back down, otherwise send message to BigFancyDoor
  618.     if (GetThingFlags(eye) & 0x10)
  619.     {
  620.         PlaySoundThing(turnstop, jackalbase, 1, -1, -1, 0);
  621.         StopSound(cursound, 0.1);
  622.         call movejackal;
  623.     }
  624.     else
  625.     {
  626.         # if pushblock is in the way, prepare to trigger doorcall when it moves
  627.         if (blockinway)
  628.         {
  629.             blockinway = 2;
  630.             
  631.             PlaySoundThing(turnstop, jackalbase, 1, -1, -1, 0);
  632.             StopSound(cursound, 0.1);
  633.             Sleep(2.0);
  634.             call endscene;
  635.             return;
  636.         }
  637.         else
  638.         {
  639.             StartCutscene(1);
  640.             
  641.             PlaySoundThing(turnstop, jackalbase, 1, -1, -1, 0);
  642.             StopSound(cursound, 0.1);
  643.  
  644.             # make the eye sparkle a couple times
  645.             AnimateSpriteSize(sparkle, '.08 .08 0.0', '.15 .15 1.0', .1);
  646.  
  647.             # New sayline if this is the 4th time
  648.             if (global6 == 3)
  649.             {
  650.                 PlayVoice(indyactor1, there, 1, 0);
  651.             }
  652.         
  653.             Sleep(2.5);
  654.             call doorcall;
  655.             call endscene;
  656.  
  657.             blockinway = -1;
  658.         }
  659.     }
  660.  
  661.     return;
  662.  
  663. # ..............................................................................
  664.  
  665. endscene:
  666.  
  667.     call fixcams;
  668.  
  669.     TeleportThing(player, indyactor0[actornum]);
  670.     SetThingFlags(indyactor0[actornum], 0x80000);
  671.     ClearThingFlags(player, 0x80000);
  672.        
  673.     # Establish a camera position near Indy and prep follow-cam...            
  674.     SetCameraPosition(1, VectorAdd(VectorTransformToOrient(player, '-0.25 -0.05 0.0'), GetThingPos(player)));    
  675.  
  676.     # turn collision on for boxes
  677.     SetCollideType(block1, 3);
  678.     SetCollideType(block2, 3);
  679.     SetCollideType(block3, 3);
  680.  
  681.     SetCurrentCamera(1);
  682.     ResetCameraFOV(0, 0.0);
  683.  
  684.     EndCutscene();
  685.     ClearActorFlags(player, 0x200000);
  686.  
  687.     return;
  688.  
  689. # ..............................................................................
  690.  
  691. fixcams:
  692.  
  693.     # Reset camera settings...
  694.     ResetCameraFOV(0, 0.0);
  695.     SetCameraPosInterp(2, 0);
  696.     SetCameraLookInterp(2, 0);
  697.  
  698.     return;
  699.  
  700. # ..............................................................................
  701.  
  702. doorcall:
  703.  
  704.     # Tell door to open lock
  705.     SendMessage(bigfancydoor, user1);
  706.         
  707.     # turn sparkle off
  708.     AnimateSpriteSize(sparkle, '.1 .1 0.0', '.2 .2 0.0', .1);
  709.     SetThingFlags(flame, 0x10);
  710.     
  711.     #add 1 to doorbar-removed count
  712.     global6 = global6 + 1;
  713.     
  714.     #give doorcog time to play scene (longer if door has to open)
  715.     if (global6 < 4)
  716.     {
  717.         Sleep(5.0);
  718.     }
  719.     else
  720.     {
  721.         Sleep(12.0);
  722.     }
  723.     
  724.     call fixcams;
  725.         
  726.     # turn collision on for boxes
  727.     SetCollideType(block1, 3);
  728.     SetCollideType(block2, 3);
  729.     SetCollideType(block3, 3);
  730.  
  731.     # tell lightbox cog to turn off the flame
  732.     SendMessage(boxcog, user1);
  733.     
  734.     # tell lightbox cog to turn off the flame
  735.     SendMessage(glowcog, user1);
  736.     
  737.     EndCutscene();
  738.     ClearActorFlags(player, 0x200000);
  739.  
  740.     return;
  741.  
  742. # ..............................................................................
  743.  
  744. pulse:
  745.  
  746.     vibe = RandBetween(1, 4);
  747.     if (vibe == 1)
  748.     {
  749.         posOffset = '-0.005 0.00 -0.001';
  750.         angOffset = '0.00 -0.001 0.001';
  751.     }
  752.     
  753.     if (vibe == 2)
  754.     {
  755.         posOffset = '0.005 -0.003 0.001';
  756.         angOffset = '0.001 0.00 -0.001';
  757.     }
  758.     
  759.     if (vibe == 3)
  760.     {
  761.         posOffset = '0.003 0.003 -0.003';
  762.         angOffset = '-0.001 0.003 -0.003';
  763.     }
  764.     
  765.     if (vibe == 4)
  766.     {
  767.         posOffset = '-0.001 0.00 0.003';
  768.         angOffset = '0.00 0.00 0.001';
  769.     }
  770.  
  771.     vibe = RandBetween(1, 3);
  772.     if (vibe == 1)
  773.     {
  774.         SetPulse(0.05);
  775.     }
  776.     if (vibe == 2)
  777.     {
  778.         SetPulse(0.1);
  779.     }
  780.     if (vibe == 3)
  781.     {
  782.         SetPulse(0.15);
  783.     }
  784.  
  785.     SetPOVShake(posOffSet, angOffSet, 0.1, 30.0);
  786.  
  787.     return;
  788.  
  789. end
  790.  
  791.